home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-11 | 8.3 KB | 330 lines | [TEXT/MPS ] |
- {
- File: CMApplication.p
-
- Contains: Header for Color Matching aware applications
-
- Copyright: © 1992-94 by Apple Computer, Inc., all rights reserved.
-
- }
-
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes := 0}
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- UNIT CMApplication;
- INTERFACE
- {$ENDC}
-
- {$IFC UNDEFINED UsingCMApplication}
- {$SETC UsingCMApplication := 1}
-
- {$I+}
- {$SETC CMApplicationIncludes := UsingIncludes}
- {$SETC UsingIncludes := 1}
-
- {$IFC UNDEFINED UsingTypes}
- {$I $$Shell(PInterfaces)Types.p}
- {$ENDC}
-
- {$IFC UNDEFINED UsingQuickdraw}
- {$I $$Shell(PInterfaces)Quickdraw.p}
- {$ENDC}
-
- {$IFC UNDEFINED UsingPrinting}
- {$I $$Shell(PInterfaces)Printing.p}
- {$ENDC}
-
- {$SETC UsingIncludes := CMApplicationIncludes}
-
-
- CONST
-
- gestaltColorMatchingVersion = 'cmtc';
- CMTrap = $ABEE;
-
- { PicComments }
- CMBeginProfile = 220;
- CMEndProfile = 221;
- CMEnableMatching = 222;
- CMDisableMatching = 223;
-
- { Defines for fieldMask in profile search record }
- kMatchCMMType = $00000001;
- kMatchApplProfileVersion = $00000002;
- kMatchDataType = $00000004;
- kMatchDeviceType = $00000008;
- kMatchDeviceManufacturer = $00000010;
- kMatchDeviceModel = $00000020;
- kMatchDeviceAttributes = $00000040;
- kMatchFlags = $00000080;
- kMatchOptions = $00000100;
- kMatchWhite = $00000200;
- kMatchBlack = $00000400;
-
- { Profile Header version }
- kCMApplProfileVersion = $0100;
-
- { Data types }
- rgbData = 'RGB ';
- cmykData = 'CMYK';
- grayData = 'GRAY';
- xyzData = 'XYZ ';
-
- { Device types }
- monitorDevice = 'mntr';
- scannerDevice = 'scnr';
- printerDevice = 'prtr';
- qdSystemDevice = 'sys ';
- qdGDevice = 'gdev';
-
- { Profile flags }
- CMNativeMatchingPreferred = $00000001; { Default to native not preferred }
- CMTurnOffCache = $00000002; { Default to turn on CMM cache }
-
- { Profile options }
- CMPerceptualMatch = $00000000; { Default. For photographic images }
- CMColorimetricMatch = $00000001; { Exact matching when possible }
- CMSaturationMatch = $00000002; { For solid colors }
-
- { ColorSync result codes }
- CMNoError = 0;
- CMProfileError = -170;
- CMMethodError = -171;
- CMMemFullError = -172;
- CMUnimplementedError = -173;
- CMParamError = -174;
- CMMethodNotFound = -175; { CMM not present }
- CMProfileNotFound = -176; { Responder error }
- CMProfilesIdentical = -177; { Profiles the same }
- CMCantConcatenateError = -178; { Profile can't be concatenated }
- CMCantXYZ = -179; { CMM cant handle XYZ space }
- CMCantDeleteProfile = -180; { Responder error }
- CMUnsupportedDataType = -181; { Responder error }
- CMNoCurrentProfile = -182; { Responder error }
-
- grayResponse = 0;
- redResponse = 1;
- greenResponse = 2;
- blueResponse = 3;
- cyanResponse = 4;
- magentaResponse = 5;
- yellowResponse = 6;
- ucrResponse = 7;
- bgResponse = 8;
- onePlusLastResponse = 9;
-
- { Printing Stuff that will be moved later }
- enableColorMatchingOp = 12;
- registerProfileOp = 13;
-
-
- TYPE
-
- CMMatchFlag = LONGINT;
- CMMatchOption = LONGINT;
- CMMatchRef = LONGINT;
- CWorld = LONGINT;
- CMError = LONGINT;
- CMResponseData = INTEGER;
-
- CMGamutResult = ^LONGINT; { Pointer to bit array }
-
- PixMapCallBackProcPtr = ProcPtr; { FUNCTION CallBack(progress: LONGINT; refCon: LONGINT): BOOLEAN; }
-
-
- XYZColor = RECORD
- X: INTEGER; { 1.15 bit unsigned fixed point }
- Y: INTEGER;
- Z: INTEGER;
- END;
-
-
- CMYKColor = RECORD
- cyan: INTEGER;
- magenta: INTEGER;
- yellow: INTEGER;
- black: INTEGER;
- END;
-
-
- CMColorList = ^CMColor;
- CMColor = RECORD
- CASE INTEGER OF
- 1: (rgb: RGBColor);
- 2: (xyz: XYZColor);
- 3: (cmyk: CMYKColor);
- END;
-
-
- CMHeader = RECORD
- size: LONGINT; { This is the total size of the Profile including custom data }
- CMMType: OSType; { Corresponding CMM }
- applProfileVersion: LONGINT; { Version of CMProfile format }
- dataType: OSType; { rgbData, etc. }
- deviceType: OSType; { monitorDevice, etc. }
- deviceManufacturer: OSType; { Registered with DTS }
- deviceModel: LONGINT; { Specific to Manufacturer }
- deviceAttributes: ARRAY[0..1] OF LONGINT; { Attributes like paper, ink, etc. }
- profileNameOffset: LONGINT; { Offset to profile name from top of data }
- customDataOffset: LONGINT; { Offset to custom data from top of data }
- flags: CMMatchFlag;
- options: CMMatchOption;
- white: XYZColor;
- black: XYZColor;
- END;
-
-
- CMProfileSearchRecordHandle = ^CMProfileSearchRecordPtr;
- CMProfileSearchRecordPtr = ^CMProfileSearchRecord;
-
- CMProfileSearchRecord = RECORD
- header: CMHeader;
- fieldMask: LONGINT;
- reserved: ARRAY[0..1] OF LONGINT;
- END;
-
-
- CMProfileChromaticities = RECORD
- red: XYZColor;
- green: XYZColor;
- blue: XYZColor;
- cyan: XYZColor;
- magenta: XYZColor;
- yellow: XYZColor;
- END;
-
-
- IStringHandle = ^IStringPtr;
- IStringPtr = ^IString;
-
- IString = RECORD
- theScript: ScriptCode;
- theString: Str63;
- END;
-
-
- CMProfileResponse = RECORD
- counts: ARRAY[grayResponse..bgResponse] OF INTEGER;
- data: ARRAY[0..0] OF CMResponseData;
- END;
-
-
- CMProfileHandle = ^CMProfilePtr;
- CMProfilePtr = ^CMProfile;
-
- CMProfile = RECORD
- header: CMHeader;
- profile: CMProfileChromaticities;
- response: CMProfileResponse; { Variable size }
- profileName: IString; { Variable size }
- customData: ARRAY[0..0] OF INTEGER; { Optional variable length custom CMM data. Word aligned. }
- END;
-
-
- { Printing Stuff that will be moved later }
- { PrGeneral parameter blocks }
-
- TEnableColorMatchingBlk = RECORD
- iOpCode: INTEGER;
- iError: INTEGER;
- lReserved: LONGINT;
- hPrint: THPrint;
- fEnableIt: BOOLEAN;
- END;
-
-
- TRegisterProfileBlk = RECORD
- iOpCode: INTEGER;
- iError: INTEGER;
- lReserved: LONGINT;
- hPrint: THPrint;
- fRegisterIt: BOOLEAN;
- END;
-
-
- { High Level Calls }
-
- FUNCTION BeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
- INLINE $203C, $000C, $000A, $ABEE;
-
- PROCEDURE EndMatching(myRef: CMMatchRef);
- INLINE $203C, $0004, $000B, $ABEE;
-
- FUNCTION GetProfile(deviceType: OSType; refNum: LONGINT; aProfile: CMProfileHandle;
- VAR returnedProfile: CMProfileHandle): CMError;
- INLINE $203C, $0010, $0005, $ABEE;
-
- FUNCTION SetProfile(deviceType: OSType; refNum: LONGINT; newProfile: CMProfileHandle): CMError;
- INLINE $203C, $000C, $0006, $ABEE;
-
- FUNCTION SetProfileDescription(deviceType: OSType; refNum: LONGINT; deviceData: UNIV LONGINT;
- hProfile: CMProfileHandle): CMError;
- INLINE $203C, $0010, $0010, $ABEE;
-
- FUNCTION GetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER;
- VAR foundDirID: LONGINT): CMError;
- INLINE $203C, $000C, $0011, $ABEE;
-
- FUNCTION GetIndexedProfile(deviceType: OSType; refNum: LONGINT; search: CMProfileSearchRecordHandle;
- VAR returnProfile: CMProfileHandle; VAR index: LONGINT): CMError;
- INLINE $203C, $0014, $0012, $ABEE;
-
- FUNCTION DeleteDeviceProfile(deviceType: OSType; refNum: LONGINT; deleteMe: CMProfileHandle): CMError;
- INLINE $203C, $000C, $0013, $ABEE;
-
- { Data interchange routines }
-
- FUNCTION UseProfile(profile: CMProfileHandle): CMError;
- INLINE $203C, $0004, $0008, $ABEE;
-
- PROCEDURE DrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; myRect: Rect);
- INLINE $203C, $000C, $0009, $ABEE;
-
- PROCEDURE EnableMatching(enableIt: BOOLEAN);
- INLINE $203C, $0002, $000D, $ABEE;
-
- { Profile concatenation }
-
- FUNCTION ConcatenateProfiles(thru: CMProfileHandle; dst: CMProfileHandle;
- VAR newDst: CMProfileHandle): CMError;
- INLINE $203C, $000C, $000C, $ABEE;
-
- { Profile manipulation routines }
-
- PROCEDURE GetProfileName(myProfile: CMProfileHandle; VAR IStringResult: IString);
- INLINE $203C, $0008, $000E, $ABEE;
-
- FUNCTION GetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
- INLINE $203C, $0004, $000F, $ABEE;
-
- { Low level color calculation routines }
-
- FUNCTION CWNewColorWorld(VAR myCWorld: CWorld; src: CMProfileHandle; dst: CMProfileHandle): CMError;
- INLINE $203C, $000C, $0000, $ABEE;
-
- PROCEDURE CWDisposeColorWorld(myCWorld: CWorld);
- INLINE $203C, $0004, $0001, $ABEE;
-
- FUNCTION CWMatchColors(myCWorld: CWorld; myColors: CMColorList; count: LONGINT): CMError;
- INLINE $203C, $000C, $0002, $ABEE;
-
- FUNCTION CWCheckColors(myCWorld: CWorld; myColors: CMColorList; count: LONGINT;
- result: CMGamutResult): CMError;
- INLINE $203C, $0010, $0003, $ABEE;
-
- FUNCTION CWMatchPixMap(myCWorld: CWorld; myPixMap: PixMap; progressProc: PixMapCallBackProcPtr;
- refCon: LONGINT): CMError;
- INLINE $203C, $0010, $0004, $ABEE;
-
- FUNCTION CWCheckPixMap(myCWorld: CWorld; myPixMap: PixMap; progressProc: PixMapCallBackProcPtr;
- refCon: LONGINT; VAR resultBitMap: BitMap): CMError;
- INLINE $203C, $0014, $0007, $ABEE;
-
-
- {$ENDC UsingCMApplication}
-
- {$IFC NOT UsingIncludes}
- END.
- {$ENDC}
-